'use strict';

function getSessionFromCookie(cookies) {
  let cookieString;
  for (const i in cookies) {
    if (!cookies.hasOwnProperty(i)) continue;
    if (cookies[i].indexOf('EGG_SESS') !== -1) {
      cookieString = cookies[i];
      break;
    }
  }
  return cookieString;
}

module.exports = getSessionFromCookie;
